import React, { useContext, useEffect } from "react";
import Taro from "@tarojs/taro";
import { Button, View } from '@tarojs/components'
import './products.less'
import { UserContext } from "../../app";


export default () => {
  const { user } = useContext(UserContext)

  useEffect(() => {
  }, [])

  const click = () => {
    Taro.reLaunch({ url: '/pages/mall/mall' })
  }

  return (
    <View>
      下单成功，剩余积分: {user.points}

      <Button onClick={click}>返回商城</Button>
      <Button onClick={() => Taro.redirectTo({ url: '/pages/orders/orders?status=ALL' })}>我的订单</Button>
    </View>
  )
}

